package com.wxm.servlet;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.xm.dao.LianXiDaoImpl;
import com.xm.entity.LianXi;

/**
 * Servlet implementation class LianXiServlet
 */
@WebServlet("/LianXiServlet")
public class LianXiServlet extends BaseServlet {

	/**
	 * 地址http://localhost:8080/javaweb-Furniture/LianXiServlet?method=tiao
	 */
	public void tiao(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

		// 单个联系信息
		LianXiDaoImpl dao3 = new LianXiDaoImpl();
		LianXi com2 = dao3.getCom().get(0);

		HttpSession session = req.getSession();
		session.setAttribute("com2", com2);
		// 跳转页面（请求转发）

		req.getRequestDispatcher("lianxitiao.jsp").forward(req, resp);
	}

}
